$(document).ready(function () {
   $(document).ajaxStart(function(){
      $('.jload').show();
    });
    $(document).ajaxStop(function(){
      $('.jload').hide();
    });

   COMMONURL='http://api.qy.7yunbao.cn/';

    $.ajax({
            url: COMMONURL + "api/Account/CheckToken?token=" + $.cookie('token'),
            type: "post",
            dataType: "json"
        }).done(function(redata) {
            if (redata.recode != '0000') {
                window.location.href = '/nlogin.html';
            }
        });


  
   //COMMONURL='http://localhost:56981/';


   $.extend({
		ajaxSend:function(url,sdata,callback){
			$.ajax({
	   			url:COMMONURL+url,
	   			type:"post",
	   			data:sdata,
	   			dataType:"json"
	   		}).done(function(redata){
	   			if(callback && typeof callback == 'function'){
	   				callback(redata);
	   			}else{
	   				alert(11);
	   			}
	   		});
		}
   });
   
 }); 